package com.ucode.application.security;

import org.springframework.stereotype.Service;
import com.ucode.springboot.starter.security.service.UcodePasswordVerifier;
import cn.hutool.core.util.StrUtil;

@Service
public class UcodePasswordVerifierImpl implements UcodePasswordVerifier {

    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
          if(StrUtil.isBlank(encodedPassword)){
          return true;
      }else{
    //      String pass = DigestUtil.md5Hex(encodedPassword);
    //      return pass.equals(rawPassword.toString());//用户输入密码为null校验在网关层做,这里不做
          return rawPassword.equals(encodedPassword);
      }
    }

}
